package com.zxzhu.joyread.View;

import android.graphics.drawable.AnimationDrawable;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

import com.zxzhu.joyread.Common.BaseActivity;
import com.zxzhu.joyread.Presenter.WelcomePresenter;
import com.zxzhu.joyread.R;

/**
 * Created by Administrator on 2017/7/28 0028.
 */

public class WelcomeView extends BaseActivity implements IWelcomeView {
    private Button but_skip;
    private ImageView welcome_img;
    private WelcomePresenter presenter;
    private AnimationDrawable animationDrawable;

    @Override
    protected void initData() {
        but_skip = $(R.id.wel_skip);
        welcome_img = $(R.id.wel_img);
        presenter = new WelcomePresenter(this,this);
        presenter.setGif(R.drawable.welcome,welcome_img);
        but_skip.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                presenter.skip();
            }
        });
    }
//    private class AnimationImpl implements AnimationListener {
//        @Override
//        public void onAnimationStart(Animation animation) {
//            toast("hi,今天读书了吗");
//        }
//
//        @Override
//        public void onAnimationEnd(Animation animation) {
//            presenter.skip();
//        }
//
//        @Override
//        public void onAnimationRepeat(Animation animation) {
//
//        }
//    }
    @Override
    protected int getContentViewId() {
        return R.layout.activity_welcome;
    }

}
